/**
@author		Jong Min, Lee
@date		  02/13/2014
@brief		study view style

copyright(c) Tae Young Soft. All right reserved. 2014
*/
#include "stdafx.h"
#include "Taurus_Viewer/StudyViewStyle.h"

#define NORMAL_TITLE_BAR_BK_COLOR   RGB(45, 45, 48)
#define NORMAL_TITLE_BAR_TEXT_COLOR RGB(255, 255, 255)
#define FOCUSED_TITLE_BAR_BK_COLOR  RGB(0, 122, 204)
#define FOCUSED_TITLE_BAR_TEXT_COLOR RGB(255, 255, 255)

enum 
{
  STUDY_TITLE_BAR_HEIGHT_NORMAL = 24,
  STUDY_TITLE_BAR_HEIGHT_3M     = 40,
  STUDY_TITLE_BAR_HEIGHT_5M     = 40,

  STUDY_TITLE_BAR_BTN_LEFT_MARGIN_NORMAL    = 2,
  STUDY_TITLE_BAR_BTN_LEFT_MARGIN_3M        = 2,
  STUDY_TITLE_BAR_BTN_LEFT_MARGIN_5M        = 2,
  STUDY_TITLE_BAR_BTN_TOP_MARGIN_NORMAL     = 2,
  STUDY_TITLE_BAR_BTN_TOP_MARGIN_3M         = 3,
  STUDY_TITLE_BAR_BTN_TOP_MARGIN_5M         = 3,
  STUDY_TITLE_BAR_BTN_RIGHT_MARGIN_NORMAL   = 2,
  STUDY_TITLE_BAR_BTN_RIGHT_MARGIN_3M       = 2,
  STUDY_TITLE_BAR_BTN_RIGHT_MARGIN_5M       = 2,
  STUDY_TITLE_BAR_BTN_BOTTOM_MARGIN_NORMAL  = 2,
  STUDY_TITLE_BAR_BTN_BOTTOM_MARGIN_3M      = 3,
  STUDY_TITLE_BAR_BTN_BOTTOM_MARGIN_5M      = 3,

  OPEN_STUDY_LIST_BTN_WIDTH_NORMAL =  20,
  OPEN_STUDY_LIST_BTN_WIDTH_3M     =  34,
  OPEN_STUDY_LIST_BTN_WIDTH_5M     =  34,
  OPEN_STUDY_LIST_BTN_HEIGHT_NORMAL = 26,
  OPEN_STUDY_LIST_BTN_HEIGHT_3M     = 34,
  OPEN_STUDY_LIST_BTN_HEIGHT_5M     = 34,

  SERIES_LAYOUT_CMB_WIDTH_NORMAL    = 60,
  SERIES_LAYOUT_CMB_WIDTH_3M        = 60,
  SERIES_LAYOUT_CMB_WIDTH_5M        = 60,

  SERIES_LAYOUT_CMB_HEIGHT_NORMAL   = 20,
  SERIES_LAYOUT_CMB_HEIGHT_3M       = 34,
  SERIES_LAYOUT_CMB_HEIGHT_5M       = 34,

  CLOSE_STUDY_BTN_WIDTH_NORMAL      = 20,
  CLOSE_STUDY_BTN_WIDTH_3M          = 34,
  CLOSE_STUDY_BTN_WIDTH_5M          = 34,

  CLOSE_STUDY_BTN_HEIGHT_NORMAL     = 20,
  CLOSE_STUDY_BTN_HEIGHT_3M         = 34,
  CLOSE_STUDY_BTN_HEIGHT_5M         = 34
};

int CStudyViewStyle::getTitlebarHeight(MonitorResolutionType resType)
{
  int height = 0;
  switch (resType)
  {
  case MonitorResolution_Normal:
    height = STUDY_TITLE_BAR_HEIGHT_NORMAL;
    break;
  case MonitorResolution_3M:
    height = STUDY_TITLE_BAR_HEIGHT_3M;
    break;
  case MonitorResolution_5M:
    height = STUDY_TITLE_BAR_HEIGHT_5M;
    break;
  default:
    break;
  }

  return height;
}

void CStudyViewStyle::getNormalTitleBarClr(COLORREF& bkClr, COLORREF& textClr)
{
  bkClr = NORMAL_TITLE_BAR_BK_COLOR;
  textClr = NORMAL_TITLE_BAR_TEXT_COLOR;
}

void CStudyViewStyle::getFocusedTitleBarClr(COLORREF& bkClr, COLORREF& textClr)
{
  bkClr = FOCUSED_TITLE_BAR_BK_COLOR;
  textClr = FOCUSED_TITLE_BAR_TEXT_COLOR;
}

CRect CStudyViewStyle::getTitleBarBtnMargin(MonitorResolutionType resType)
{
  CRect margin;
  switch (resType)
  {
  case MonitorResolution_Normal:
    margin.left   = STUDY_TITLE_BAR_BTN_LEFT_MARGIN_NORMAL;
    margin.top    = STUDY_TITLE_BAR_BTN_TOP_MARGIN_NORMAL;
    margin.right  = STUDY_TITLE_BAR_BTN_RIGHT_MARGIN_NORMAL;
    margin.bottom = STUDY_TITLE_BAR_BTN_BOTTOM_MARGIN_NORMAL;
    break;
  case MonitorResolution_3M:
    margin.left   = STUDY_TITLE_BAR_BTN_LEFT_MARGIN_3M;
    margin.top    = STUDY_TITLE_BAR_BTN_TOP_MARGIN_3M;
    margin.right  = STUDY_TITLE_BAR_BTN_RIGHT_MARGIN_3M;
    margin.bottom = STUDY_TITLE_BAR_BTN_BOTTOM_MARGIN_3M;
    break;
  case MonitorResolution_5M:
    margin.left   = STUDY_TITLE_BAR_BTN_LEFT_MARGIN_5M;
    margin.top    = STUDY_TITLE_BAR_BTN_TOP_MARGIN_5M;
    margin.right  = STUDY_TITLE_BAR_BTN_RIGHT_MARGIN_5M;
    margin.bottom = STUDY_TITLE_BAR_BTN_BOTTOM_MARGIN_5M;
    break;
  default:
    break;
  }
  return margin;
}

CSize CStudyViewStyle::getOpenStudyListBtnSize(MonitorResolutionType resType)
{
  CSize csSize;
  switch (resType)
  {
  case MonitorResolution_Normal:
    csSize.cx = OPEN_STUDY_LIST_BTN_WIDTH_NORMAL;
    csSize.cy = OPEN_STUDY_LIST_BTN_HEIGHT_NORMAL;
    break;
  case MonitorResolution_3M:
    csSize.cx = OPEN_STUDY_LIST_BTN_WIDTH_3M;
    csSize.cy = OPEN_STUDY_LIST_BTN_HEIGHT_5M;
    break;
  case MonitorResolution_5M:
    csSize.cx = OPEN_STUDY_LIST_BTN_WIDTH_5M;
    csSize.cy = OPEN_STUDY_LIST_BTN_HEIGHT_5M;
    break;
  default:
    break;
  }
  return csSize;
}

CSize CStudyViewStyle::getSeriesViewLayoutComboSize(MonitorResolutionType resType)
{
  CSize csSize;
  switch (resType)
  {
  case MonitorResolution_Normal:
    csSize.cx = SERIES_LAYOUT_CMB_WIDTH_NORMAL;
    csSize.cy = SERIES_LAYOUT_CMB_HEIGHT_NORMAL;
    break;
  case MonitorResolution_3M:
    csSize.cx = SERIES_LAYOUT_CMB_WIDTH_3M;
    csSize.cy = SERIES_LAYOUT_CMB_HEIGHT_3M;
    break;
  case MonitorResolution_5M:
    csSize.cx = SERIES_LAYOUT_CMB_WIDTH_5M;
    csSize.cy = SERIES_LAYOUT_CMB_HEIGHT_5M;
    break;
  default:
    break;
  }
  return csSize;
}

CSize CStudyViewStyle::getCloseStudyBtnSize(MonitorResolutionType resType)
{
  CSize csSize;
  switch (resType)
  {
  case MonitorResolution_Normal:
    csSize.cx = CLOSE_STUDY_BTN_WIDTH_NORMAL;
    csSize.cy = CLOSE_STUDY_BTN_HEIGHT_NORMAL;
    break;
  case MonitorResolution_3M:
    csSize.cx = CLOSE_STUDY_BTN_WIDTH_3M;
    csSize.cy = CLOSE_STUDY_BTN_HEIGHT_3M;
    break;
  case MonitorResolution_5M:
    csSize.cx = CLOSE_STUDY_BTN_WIDTH_5M;
    csSize.cy = CLOSE_STUDY_BTN_HEIGHT_5M;
    break;
  default:
    break;
  }
  return csSize;
}
